<?php
/*
package : adLeeX plugin
Description: This plugin allow to extend new taxonomy to post. 
Version: 1.0
Author: Luca De Cristofano
Author URI: #
License: GPL2
 */

// fissa gli hook

function adleex_post_hooks()
{
	register_activation_hook(__FILE__, 'adleex_post_rewrite_flush'); 
	add_action('init', 'adleex_post_init'); 
	add_filter('post_available_statuses','adleex_post_filter_status');
	

}

function adleex_post_filter_status($statuses) {

	$new_statuses = array();

	$new_statuses['draft']      = $statuses['draft'];
	$new_statuses['pending']    = $statuses['pending'];
	$new_statuses['publish']    = $statuses['publish'];
	$new_statuses['fucture']     = $statuses['fucture'];

	return $new_statuses;
}

// inizializza quello che serve
function adleex_post_init()
{
        register_taxonomy_for_object_type('adleex_topic', 'post');       
        
}

// serve per gestire i permalink
function adleex_post_rewrite_flush()
{
	adleex_post_init();
	flush_rewrite_rules();
}



adleex_post_hooks();

?>
